#ifndef  HELPER_OBJECT_RAWTYPE_H
#define  HELPER_OBJECT_RAWTYPE_H

#include "helper/object/Object.h"

namespace helper {
namespace object {

template<typename V, Object::Type type>
class RawType : public Object {
public:
    typedef V ValueType;
    RawType() : Object(type) {}
    ~RawType() override {}

    virtual const V set(const V value) = 0;
    virtual const V get() const = 0;

    bool operator ==(const RawType<V, type> & right) const {
        return equals(right);
    }
    bool operator !=(const RawType<V, type> & right) const{
        return !(*this == right);
    }
    bool operator ==(const V & right) const {
        return get() == right;
    }
    bool operator !=(const V & right) const{
        return !(*this == right);
    }
};
template<typename T, Object::Type type>
bool operator ==(const T & v, const RawType<T, type>  & right){
    return v == right.get();
}
template<typename T, Object::Type type>
bool operator !=(const T & v, const RawType<T, type>  & right){
    return !(v == right.get());
}

typedef RawType<char, Object::BYTE> Byte;
typedef RawType<long long, Object::INTEGER> Integer;
typedef RawType<double, Object::DOUBLE> Double;

} // end of namespace object
} // end of namespace helper

#endif   /* HELPER_OBJECT_RAWTYPE_H */
